/* This file contains the eventDispatcher thread code*/

#include "projectHeader.h"

void* checkTimeOutThread(void* t)
{
	sleep(joinTimeOut+1);
	pthread_mutex_lock(&checkTimeoutMutex);
	if(!checkFlagReceived)
	{
		//printf("\n(((((((((((((((((CHECK TIMEOUT OCCURED))))))))))))))))))))\n");
		//signal(SIGSEGV,sig_func);
		
		broadCastSent = true;
		pthread_cond_broadcast(&checkTimeoutCV);
		//printf("SV_NODE:check timeout got signal to Restart got signal to Restart  got signal to Restart  from check ");
			//	 printf("CHECK TIME OUT: Signalled restart CV mutex\n");

		//checkFlagReceived=false;
	}
	else
	{
		checkFlagReceived=false;
	}
	pthread_mutex_unlock(&checkTimeoutMutex); 
	pthread_exit(NULL);
}
